home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / packer.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-13  |  1.6 KB  |  87 lines

  1. /*
  2.  * This program is copyright Alec Muffett 1993. The author disclaims all 
  3.  * responsibility or liability with respect to it's usage or its effect 
  4.  * upon hardware or computer systems, and maintains copyright as set out 
  5.  * in the "LICENCE" document which accompanies distributions of Crack v4.0 
  6.  * and upwards.
  7.  */
  8.  
  9. #ifndef CRACKLIB_PACKER_H
  10. #define CRACKLIB_PACKER_H
  11.  
  12. /* Moved here cause needed by mod_php */
  13. #define STRINGSIZE    1024
  14. #define TRUNCSTRINGSIZE    (STRINGSIZE/4)
  15.  
  16. #ifndef NUMWORDS
  17. #define NUMWORDS     16
  18. #endif
  19. #define MAXWORDLEN    32
  20. #define MAXBLOCKLEN     (MAXWORDLEN * NUMWORDS)
  21.  
  22. #ifdef IN_CRACKLIB
  23.  
  24. #include <stdio.h>
  25. #include <ctype.h>
  26. #include <crack.h>
  27.  
  28. #if defined(HAVE_INTTYPES_H)
  29. #include <inttypes.h>
  30. #else
  31. #if defined(HAVE_STDINT_H)
  32. #include <stdint.h>
  33. #else
  34. typedef unsigned int uint32_t;
  35. typedef unsigned short uint16_t;
  36. #endif
  37. #endif
  38.  
  39.  
  40. struct pi_header
  41. {
  42.     uint32_t pih_magic;
  43.     uint32_t pih_numwords;
  44.     uint16_t pih_blocklen;
  45.     uint16_t pih_pad;
  46. };
  47.  
  48. typedef struct
  49. {
  50.     FILE *ifp;
  51.     FILE *dfp;
  52.     FILE *wfp;
  53.  
  54.     uint32_t flags;
  55. #define PFOR_WRITE    0x0001
  56. #define PFOR_FLUSH    0x0002
  57. #define PFOR_USEHWMS    0x0004
  58.  
  59.     uint32_t hwms[256];
  60.  
  61.     struct pi_header header;
  62.  
  63.     int count;
  64.     char data[NUMWORDS][MAXWORDLEN];
  65. } PWDICT;
  66.  
  67. #define PW_WORDS(x) ((x)->header.pih_numwords)
  68. #define PIH_MAGIC 0x70775631
  69.  
  70. /* Internal routines */
  71. extern char *GetPW(PWDICT *pwp, uint32_t number);
  72.  
  73. #else
  74.  
  75. /* Dummy structure, this is an internal only opaque data type */
  76. typedef struct {
  77.     int dummy;
  78. } PWDICT;
  79.  
  80. #endif
  81.  
  82. extern PWDICT *PWOpen(char *prefix, char *mode);
  83. extern char *Mangle(char *input, char *control);
  84.  
  85.  
  86. #endif
  87.